<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style> 
        div {
            position: relative;
            width: 200px;
            height: 50px;
            border: 1px solid #000;
        }

        div::after{
            content: '';
            position: absolute;
            right: 10px;
            top: 10px;
            width: 20px;
            height: 20px;
            border-right: solid 1px #000;
            border-bottom: solid 1px #000;
            transform: rotate(45deg);
            transition: all 2s;
        }

        div:hover::after {
            transform: rotate(225deg);
        }

    </style>

</head>
<body>
    <div></div>
</body>
</html>